package com.lechuang.thread.util;

import jakarta.annotation.PostConstruct;
import jakarta.annotation.Resource;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Component;

/**
 * <p>
 *
 * </p>
 * @author liaoningbo
 * @since 2023/6/7
*/
@Component
public class ThreadUtil {
    @Resource
    private ThreadPoolTaskExecutor threadPoolTaskExecutor;

    private static ThreadPoolTaskExecutor threadPool;

    @PostConstruct
    public void init() {
        threadPool = threadPoolTaskExecutor;
    }

    public static ThreadPoolTaskExecutor getThreadPoolTaskExecutor(){
        return threadPool;
    }
}
